package com.zzj.service;

import com.zzj.base.Result;
import com.zzj.model.dto.mail.MessageDTO;
import jakarta.annotation.Resource;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Service
public class MailService {

    @Resource
    private JavaMailSender mailSender;


    public void sendAdmin(String content) {
        String to = "1127394608@qq.com";
        String title = "用户操作提示";
        SimpleMailMessage message = new SimpleMailMessage();
        message.setFrom("wesley@zzjtpp.top");
        message.setTo(to);
        message.setSubject(title);
        message.setText(content);
        mailSender.send(message);
    }
}
